package imageProcessing.filter;

import imageProcessing.ImageEvent;
import imageProcessing.ImageListener;

import java.beans.EventSetDescriptor;
import java.beans.MethodDescriptor;
import java.beans.ParameterDescriptor;
import java.beans.SimpleBeanInfo;
import java.lang.reflect.Method;

public class DilateFilterBeanInfo extends SimpleBeanInfo {

	  public EventSetDescriptor[] getEventSetDescriptors() {
		    try {
		      EventSetDescriptor esd1;
		      Class c = DilateFilter.class;
		      String es = "image";
		      Class lc = ImageListener.class;
		      
		      String names[] = { "imageChanged" };
		      String al = "addImageListener";
		      String rl  = "removeImageListener";
		      esd1 = new EventSetDescriptor(c, es, lc, names, al, rl);
		     		      
		      EventSetDescriptor esd[] = { esd1 };
		      return esd;
		    }
		    catch(Exception ex) {
		      ex.printStackTrace();
		    }
		    return null;
		  }
  
  public MethodDescriptor[] getMethodDescriptors() {
    try {
      Class c = DilateFilter.class;
      
      Class parameterTypes[] = new Class[1];
      parameterTypes[0] = ImageEvent.class;
      String name = "imageChanged";
      
      Method method1 = c.getMethod(name, parameterTypes);
      ParameterDescriptor pds[] = new ParameterDescriptor[1];
      pds[0] = new ParameterDescriptor();
      
      MethodDescriptor md1;
      md1 = new MethodDescriptor(method1, pds);
            
      MethodDescriptor mds[] = { md1 };
      return mds;
    }
    catch(Exception ex) {
      ex.printStackTrace();
    }
    return null;
  }
}